***** OPEN OUTPUT LOG FILE FOR APPENDIX F ANALYSES: "HARDIWRING MUTUAL COMMITTMENT" *****



*log "C:\Users\gk57526\Dropbox\Confirmation Dynamics Project (Jason Byers)\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Output\Hardwiring Committment.APPENDIX F.04-21-2023.smcl" 

log using "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Output\Hardwiring Committment.APPENDIX F.04-21-2023.smcl", replace



*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





**** APPENDIX F STATISTICAL ANALYSES: REPLICATE MANUSCRIPT MODELS -- SPLIT INTO SINGLE TERM PRESIDENTS [CARTER & BUSH41] VERSUS TWO-TERM PRESIDENTS [REAGAN, CLINTON, & BUSH 43] ****
**** SINGLE TERM PRESIDENTS [N = 246, 28.61% OF FULL SAMPLE]; TWO TERM PRESIDENTS [N = 614, 71.39% OF FULL SAMPLE] ****

use "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Data\Krause and Byers.SRD.06-03-2022.dta", replace






*** DESCRIPTIVE STATISTICS OF SPLIT PRESIDENTIAL SUBSAMPLES BY NUMBER OF TERMS]: EMPLOY IN CALCULATING MARGINAL EFFECTS FROM REGRESSION MODELS BELOW ***

sum zloyalmedian if carter==1 | bush41==1, detail

sum zloyalmedian if reagan==1 | clinton==1 | bush43==1, detail




** GENERATE CENSORING VARIABLE FOR HOLDOVER APPOINTEES SERVING BETWEEN/ACROSS ADMINISTRATIONS [=1]; UNCENSRED OBSERVATIONS [=0] ** 

gen singleadmin_service=1 if holdover==0
*
replace singleadmin_service=0 if holdover==1
*
*
tab singleadmin_service


** SET FOR SURVIVAL DATA WITH A SINGLE RECORD PER APPOINTEE OBSERVATION [N = 860: UNCENSORED N = 831; CENSORED N = 29] ** 
stset okapptdur, failure(singleadmin_service)
*



*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

*
*
*

** ESTIMATE COX SEMIPARAMETRIC AND WEIBULL PARAMETRIC MODELS PRESENTED IN MANUSCRIPT [MODELS G1A - G4B] ** 

** NOTE COVARIATES THAT VARY TRHOUGH TIME ARE BASED ON THE STARTING DATE OF APPOINTED SERVICE [I.E., "OKSTART....""]




**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





*** MANUSCRIPT-BASED SURVIVAL REGRESSION ANALYSES: COX SEMIPARAMETRIC & WEIBULL PARAMETRIC MODELS ****




******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




**** APPENDIX F REGRESSION MODELS  ***



**** MODEL F1A: COX MODEL [OMISSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i.okstartadyr if carter==1 | bush41==1,  hr vce(cluster sbagency)
*
estat ic

estimates store modelF1A
estout modelF1A, cells(b(star fmt(3)) se(par fmt(3))) eform


*** COMPUTE Figure F1A: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MF1A−MF4A] × 1 Horizontal Point Estimates and 95% CIs}}. ****
*** NOTE: IQR = 0.8404716 [0.4018788 - (-0.4385928)] ***

 

** ONE INTERQUARTILE RANGE MARGINAL EFFECT INCREASE IN APPOINTEE LOYALTY DIFFERENTIAL BETWEEN POLICY PRIORITY AGENCY VERSUS NON-POLICY PRIORITY AGENCY [FIGURE F1] **

lincomest 1.soubinaryagency2nom#c.zloyalmedian*0.8404716, eform(hr)
matrix modelF1Azloyal = r(table)
mat list modelF1Azloyal
*


******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



**** MODEL G1B: COX MODEL [OMISSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i.okstartadyr  if reagan==1 | clinton==1 | bush43==1,  hr vce(cluster sbagency)
*
estat ic

estimates store modelF1B
estout modelF1B, cells(b(star fmt(3)) se(par fmt(3))) eform


*** COMPUTE Figure F1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MF1B−MF4B] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQR =  1.3600037  [0.9816979 - (-0.3783058)] ***



** ONE INTERQUARTILE RANGE MARGINAL EFFECT INCREASE IN APPOINTEE LOYALTY DIFFERENTIAL BETWEEN POLICY PRIORITY AGENCY VERSUS NON-POLICY PRIORITY AGENCY [FIGURE F1] **

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.3600037, eform(hr)
matrix modelF1Bzloyal = r(table)
mat list modelF1Bzloyal
*




******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



**** MODEL F2A: COX MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i.okstartadyr  i.sbagency bush41 if carter==1 | bush41==1,  hr vce(cluster sbagency)
*
estat ic

estimates store modelF2A
estout modelF2A, cells(b(star fmt(3)) se(par fmt(3))) eform


*** COMPUTE Figure F1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MF1A−MF4A] × 1 Horizontal Point Estimates and 95% CIs}}. ****
*** NOTE: IQR = 0.8404716 [0.4018788 - (-0.4385928)] ***

lincomest 1.soubinaryagency2nom#c.zloyalmedian*0.8404716, eform(hr)
matrix modelF2Azloyal = r(table)
mat list modelF2Azloyal



******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



**** MODEL F2B: COX MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

stcox   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp  okstartunemployment  i.okstartadyr  i.sbagency clinton bush43 if reagan==1 | clinton==1 | bush43==1,  hr vce(cluster sbagency)
*
estat ic

estimates store modelF2B
estout modelF2B, cells(b(star fmt(3)) se(par fmt(3))) eform


*** COMPUTE Figure F1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MF1B−MF4B] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQR =  1.3600037  [0.9816979 - (-0.3783058)] ***

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.3600037, eform(hr)
matrix modelF2Bzloyal = r(table)
mat list modelF2Bzloyal



**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




**** MODEL F3A: WEIBULL MODEL [OMISSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr if carter==1 | bush41==1,   distribution(weibull)  hr vce(cluster sbagency)
*
estat ic

estimates store modelF3A
estout modelF3A, cells(b(star fmt(3)) se(par fmt(3))) eform


*** COMPUTE Figure F1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MF1A−MF4A] × 1 Horizontal Point Estimates and 95% CIs}}. ****
*** NOTE: IQR = 0.8404716 [0.4018788 - (-0.4385928)] ***

lincomest 1.soubinaryagency2nom#c.zloyalmedian*0.8404716, eform(hr)
matrix modelF3Azloyal = r(table)
mat list modelF3Azloyal



**** COMPUTE Figure F2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [MF1A−MF4A] × 1 Horizontal Point Estimates and 95% CIs}.



** Generate 'manual' interaction variable ** 
generate loyalppdiff = soubinaryagency2nom*zloyalmedian

** Re-Estimate Model F3A  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr  if carter==1 | bush41==1, distribution(weibull) hr vce(cluster sbagency)

estimate store modelF3Aa


margins, predict(median time) at(loyalppdiff=(-0.4385928  0.4018788))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(loyalppdiff=(-0.4385928  0.401878))  contrast(atcontrast(r))
matrix modelF3Aazloyal = r(table)
mat list modelF3Aazloyal




estimates restore modelF3Aa

margins, predict(median time) at(loyalppdiff=(-0.8003148 1.753017))
margins, predict(median time) at(loyalppdiff=(-0.8003148 1.753017))  contrast(atcontrast(r))

matrix modelF3Abzloyal = r(table)
mat list modelF3Abzloyal




******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





**** MODEL F3B: WEIBULL MODEL [OMISSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr if reagan==1 | clinton==1 | bush43==1,   distribution(weibull)  hr vce(cluster sbagency)
*
estat ic

estimates store modelF3B
estout modelF3B, cells(b(star fmt(3)) se(par fmt(3))) eform


*** COMPUTE Figure F1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MF1B−MF4B] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQR =  1.3600037  [0.9816979 - (-0.3783058)] ***

lincomest 1.soubinaryagency2nom#c.zloyalmedian* 1.3600037, eform(hr)
matrix modelF3Bzloyal = r(table)
mat list modelF3Bzloyal



**** COMPUTE Figure F2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [MF1B−MF4B] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3600037 [0.9816979 - (-0.3783058)] ***


** Generate 'manual' interaction variable ** 
*generate loyalppdiff = soubinaryagency2nom*zloyalmedian

** Re-Estimate Model F3B  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr  if reagan==1 | clinton==1 | bush43==1,  distribution(weibull) hr vce(cluster sbagency)

estimate store modelF3Ba


margins, predict(median time) at(loyalppdiff=(-0.3783058  0.9816979))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(loyalppdiff=(-0.3783058  0.9816979))  contrast(atcontrast(r))
matrix modelF3Bazloyal = r(table)
mat list modelF3Bazloyal




estimates restore modelF3Ba

margins, predict(median time) at(loyalppdiff=(-0.6247732 1.690957))
margins, predict(median time) at(loyalppdiff=(-0.6247732 1.690957))  contrast(atcontrast(r))

matrix modelF3Bbzloyal = r(table)
mat list modelF3Bbzloyal




******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




**** MODEL F4A: WEIBULL MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr  i.sbagency bush41 if carter==1 | bush41==1, distribution(weibull) hr vce(cluster sbagency)
*
estat ic

estimates store modelF4A
estout modelF4A, cells(b(star fmt(3)) se(par fmt(3))) eform



*** COMPUTE Figure F1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MF1A−MF4A] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQR = 0.8404716 [0.9746053 - (-0.3853984)]

lincomest 1.soubinaryagency2nom#c.zloyalmedian*0.8404716, eform(hr)
matrix modelF4Azloyal = r(table)
mat list modelF4Azloyal




**** COMPUTE Figure F2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [MF1A−MF4A] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 0.8404716 [0.401878 - (-0.4385928)]

** Re-Estimate Model F4A  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr i.sbagency if carter==1 | bush41==1, distribution(weibull) hr vce(cluster sbagency)

estimates store modelF4Aa

margins, predict(median time) at(loyalppdiff=(-0.4385928  0.401878))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(loyalppdiff=(-0.4385928  0.401878))  contrast(atcontrast(r))

matrix modelF4Aazloyal = r(table)
mat list modelF4Aazloyal



estimates restore modelF4Aa

margins, predict(median time) at(loyalppdiff=(-0.8003148 1.753017))
margins, predict(median time) at(loyalppdiff=(-0.8003148 1.753017))  contrast(atcontrast(r))

matrix modelF4Abzloyal = r(table)
mat list modelF4Abzloyal






******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




**** MODEL F4B: WEIBULL MODEL [INCLUSION OF BOTH AGENCY AND PRESIDENTIAL ADMINISTRATION FIXED EFFECTS: CLUSTER-ADJUSTED STANDARD ERRORS BY AGENCY] ****

streg   c.zloyalmedian##i.soubinaryagency2nom  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr  i.sbagency clinton bush43 if reagan==1 | clinton==1 | bush43==1, distribution(weibull) hr vce(cluster sbagency)
*
estat ic

estimates store modelF4B
estout modelF4B, cells(b(star fmt(3)) se(par fmt(3))) eform



*** COMPUTE Figure F1: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the HAZARD RATIO of APPOINTEE TENURE {PP − NPP Difference} {{4 [MF1B−MF4B] × 1 Horizontal Point Estimates and 95% CIs}}. ****
** NOTE: IQR = 1.3600037 [0.9816979 - (-0.3783058)]

lincomest 1.soubinaryagency2nom#c.zloyalmedian*1.3600037, eform(hr)
matrix modelF4Bzloyal = r(table)
mat list modelF4Bzloyal




**** COMPUTE Figure F2: Interquartile Increase Marginal Effect Change of Appointee Loyalty on the MEDIAN NUMBER OF DAYS OF APPOINTEE TENURE {PP − NPP Difference} {{4 [MF1B−MF4B] × 1 Horizontal Point Estimates and 95% CIs}.
** NOTE: IQR = 1.3600037 [0.9816979 - (-0.3783058)]

** Re-Estimate Model F4B  with 'manual' interaction variable **
streg   zloyalmedian soubinaryagency2nom loyalppdiff  zpecompmedian  zmecompmedian   toplevel2   presagencyideolalign  presagencyideolopposed subagencydesign standaloneagencydesign  okstartsenpolarizationmean okstartfilipresdistance   okcrossover okstartpresapp okstartunemployment  i.okstartadyr i.sbagency clinton bush43 if reagan==1 | clinton==1 | bush43==1, distribution(weibull) hr vce(cluster sbagency)

estimates store modelF4Ba

margins, predict(median time) at(loyalppdiff=(-0.3783058  0.9816979))

** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(loyalppdiff=(-0.3783058  0.9816979))  contrast(atcontrast(r))

matrix modelF4Bazloyal = r(table)
mat list modelF4Bazloyal



estimates restore modelF4Ba

margins, predict(median time) at(loyalppdiff=(-0.6247732 1.690957))
margins, predict(median time) at(loyalppdiff=(-0.6247732 1.690957))  contrast(atcontrast(r))

matrix modelF4Bbzloyal = r(table)
mat list modelF4Bbzloyal



***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*Figure F1

matrix pointmodel = modelF1Azloyal[1,1], modelF1Bzloyal[1,1], modelF2Azloyal[1,1], modelF2Bzloyal[1,1], modelF3Azloyal[1,1], modelF3Bzloyal[1,1], modelF4Azloyal[1,1], modelF4Bzloyal[1,1]

matrix cimodel = (modelF1Azloyal[5,1], modelF1Bzloyal[5,1], modelF2Azloyal[5,1], modelF2Bzloyal[5,1], modelF3Azloyal[5,1], modelF3Bzloyal[5,1], modelF4Azloyal[5,1], modelF4Bzloyal[5,1] \ modelF1Azloyal[6,1], modelF1Bzloyal[6,1], modelF2Azloyal[6,1], modelF2Bzloyal[6,1], modelF3Azloyal[6,1], modelF3Bzloyal[6,1], modelF4Azloyal[6,1], modelF4Bzloyal[6,1])



coefplot (matrix(pointmodel), ci((cimodel))), grid(none) xline(1, lcolor(red%40) lpattern(dash)) xtitle("Hazard Ratio", size(small) margin(t=2)) ylabel(1 "Model F1A"  2 "Model F1B"  3 "Model F2A" 4 "Model F2B" 5 "Model F3A" 6 "Model F3B" 7 "Model F4A" 8 "Model F4B", labsize(small) noticks) mlabel format(%9.3f) mlabposition(12) mlabsize(vsmall) xlabel(0(1)2, angle(0) labsize(small) format(%9.1f)) msymbol(o) mcolor(black) msize(small) title("FIGURE F1", size(small)) ciopts(lcolor(black)) subtitle("Marginal Differential Effect of Presidential Loyalty on Appointee Tenure Hazard" "[Policy Priority Agencies versus Non-Policy Priority Agencies]", size(small)) legend(order(17  18) lab(17 "FA Models Denote Single Term Presidents") lab(18 "FB Models Denote Two Term Presidents") rows(2) size(small))

graph save "Graph" "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Graphics\FigureF1.gph", replace






***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


*Figure F2

matrix pointmodelF1 = modelF3Aazloyal[1,1], modelF3Abzloyal[1,1], modelF3Bazloyal[1,1], modelF3Bbzloyal[1,1], modelF4Aazloyal[1,1], modelF4Abzloyal[1,1], modelF4Bazloyal[1,1], modelF4Bbzloyal[1,1]

matrix cimodel1 = (modelF3Aazloyal[5,1], modelF3Abzloyal[5,1], modelF3Bazloyal[5,1], modelF3Bbzloyal[5,1], modelF4Aazloyal[5,1], modelF4Abzloyal[5,1], modelF4Bazloyal[5,1], modelF4Bbzloyal[5,1] \ modelF3Aazloyal[6,1], modelF3Abzloyal[6,1], modelF3Bazloyal[6,1], modelF3Bbzloyal[6,1], modelF4Aazloyal[6,1], modelF4Abzloyal[6,1], modelF4Bazloyal[6,1], modelF4Bbzloyal[6,1])

*

coefplot (matrix(pointmodelF1), ci((cimodel1))), grid(none) xtitle("Predicted Number of Days", size(small) margin(t=2)) ylabel(1 `" "Model F3A" "Interquartile Change" "' 2 `" "Model F3A" "Interdecile Change" "' 3 `" "Model F3B" "Interquartile Change" "' 4 `" "Model F3B" "Interdecile Change" "' 5 `" "Model F4A" "Interquartile Change" "' 6 `" "Model F4A" "Interdecile Change" "' 7 `" "Model F4B" "Interquartile Change" "' 8 `" "Model F4B" "Interdecile Change" "', labsize(small) noticks) mlabel format(%9.0f) mlabposition(12) mlabsize(vsmall) xlabel(0(100)900, angle(0) labsize(small) format(%9.0f))   msymbol(o) mcolor(black) msize(small) title("FIGURE F2", size(small)) ciopts(lcolor(black)) subtitle("Marginal Differential Effect of Presidential Loyalty on Median Appointee Tenure" "[Policy Priority Agencies versus Non-Policy Priority Agencies]", size(small)) legend(order(17  18) lab(17 "FA Models Denote Single Term Presidents") lab(18 "FB Models Denote Two Term Presidents") rows(2) size(small))

graph save "Graph" "C:\Users\Jason\Dropbox\Jason Byers\Co-Authored Projects\Projects with George Krause\Krause Projects\Confirmation Dynamics Project\Appointee Tenure Project\Jason Byers\March 2023\DART (PRQ)\Graphics\FigureF2.gph", replace




***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


log close

